package org.xxf.tdengine.demo.controller;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.xxf.tdengine.demo.entity.Device;
import org.xxf.tdengine.demo.mapper.BaseDeviceMapper;

@Slf4j
@RestController
public class IndexController {

    @Resource
    private BaseDeviceMapper baseDeviceMapper;

    @GetMapping("/v1/index")
    public String index(){
        log.info("index");
        Device device = baseDeviceMapper.selectFirst();
        log.info(">>> "+device);
        return "service is running";
    }

}
